package com.bit.demo2;
class Animal{
    public String name;
    public int age;
    protected int count;
    public Animal(String name, int age){
        this.name = name;
        this.age = age;
    }
    public void eat(){
        System.out.println("eat()");
    }
}
class Dog extends Animal{
    public Dog(String name, int age){
        super(name,age);
    }

}

class Bird extends Animal{

    public String wing;
    public Bird(String name,int age, String wing){
        super(name,age);
        this.wing = wing;
    }
    public void fly(){
        System.out.println(super.name + "fly()" + super.age);//继承了我们的name
    }
}
public class TestDemo {

    public static void main(String[] args) {
        Bird bird = new Bird("heihei",18,"我要的飞翔");
        System.out.println(bird.count);
    }

    public static void main1(String[] args) {
        Dog dog = new Dog("haha",19);
        System.out.println(dog.name);
        dog.eat();

        Bird bird = new Bird("heihei",18,"我要的飞翔");
        System.out.println(bird.name);
        bird.eat();
        bird.fly();

    }
}
























